class BusLine{
    private String name;
    private String[] stations;
    //不带参数的构造方法
    public BusLine() {

    }
    //带参数的构造方法
    public BusLine(String name, String[] station) {
        this.name = name;
        this.stations = station;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String[] getStations() {
        return stations;
    }

    public void setStations(String[] stations) {
        this.stations = stations;
    }

    //查询站点方法
    public boolean containsStation(String stationName){
        for (String station : stations) {
            if (station.equals(stationName))
             return true;
        }
        return false;
    }
}
public class BusRouteQuerySystem {
    public static void main(String[] args) {
       BusLine busLine1=new BusLine("101",new String[]{"A","B","C","D","E"});
       BusLine busLine2=new BusLine("102",new String[]{"B","D","E","F","G"});
       String stationName="C";
       boolean result1=busLine1.containsStation(stationName);
       boolean result2=busLine2.containsStation(stationName);
       if(result1){
            System.out.println(busLine1.getName()+":"+"找到了包含站点"+stationName+"的公交路线");
       }else{
            System.out.println(busLine1.getName()+":"+"没有找到包含站点"+stationName+"的公交路线");
        }
       if(result2){
            System.out.println(busLine2.getName()+":"+"找到了包含站点"+stationName+"的公交路线");
        }else{
            System.out.println(busLine2.getName()+":"+"没有找到包含站点"+stationName+"的公交路线");

        }

    }
}
